package com.example.jetpacktest.room.dao

import androidx.room.*
import com.example.jetpacktest.room.bean.NameTuple
import com.example.jetpacktest.room.bean.User

@Dao
interface UserDao {

    @Insert
    fun addUser(vararg user: User)

    @Update
    fun updateUser(vararg user: User)

    @Delete
    fun deleteUser(vararg user: User)

    @Query("select * from user")
    fun getAllUsers(): List<User>

    @Query("select first_name, last_name from user")
    fun getFullNames(): List<NameTuple>

    @Query("select * from user where id in (:ids)")
    fun getUsersByIds(ids: List<Long>): List<User>

}